<?php

class m120523_101440_create_employee extends EDbMigration {

	public function safeUp() {
		$employee = array(
			'id'=>'pk',
			'name'=>'varchar(128) not null',
			'code'=>'varchar(8)',
			'residentId'=>'varchar(32)',
			'gender'=>'varchar(8)',
			'matrimony'=>'varchar(16)',
			'birthDate'=>'date',
			'employmentStatus'=>'varchar(16)',
			'employmentDate'=>'date',
			'expiredDate'=>'date',
			'unemploymentDate'=>'date',
			'position'=>'varchar(32)',
			'division'=>'varchar(32)',
			'group'=>'varchar(32)',
			'supervisorId'=>'integer',
			'address'=>'text',
			'email'=>'varchar(128)',
			'createdAt'=>'datetime',
			'updatedAt'=>'datetime',
			'createdBy'=>'integer',
			'updatedBy'=>'integer',
		);
		$this->createTable('employees', $employee);
	}

	public function safeDown() {
		$this->dropTable('employees');
	}

}